package command

import (
	"bytes"
	"text/template"
)
type MagnetoInfo struct {
	Name string
	Url string
}
type Magneto struct {
	dataStruct
}

func (m *Magneto) Read(a ...string) {
	m.flag = a
}

func (m *Magneto) Reply() {
	defer Info("magneto Reply.")
}

func (m *Magneto) Update() {

}


func (m *Magneto) Template(n, u string) string{
	defer Info("magneto Template.")
	var tpl bytes.Buffer
	const c = `
		热门词条: {{.Name}}
		链接: {{.Url}}
	`
	t, _ := template.New("t").Parse(c)
	t.Execute(&tpl, &MagnetoInfo{
		Name: n,
		Url: u,
	})
	return tpl.String()
}